# 示例调度效果创建器
class_name ExampleScheduledEffects
extends RefCounted

# 创建一个在第3回合给玩家加血的效果
static func create_healing_effect() -> ScheduledEffect:
	var effect = ScheduledEffect.new()
	effect.id = "turn_3_healing"
	effect.trigger_type = ScheduledEffect.TriggerType.TURN_COUNT
	effect.target_type = ScheduledEffect.TargetType.PLAYER
	effect.trigger_turn = 3
	effect.is_repeating = false
	
	# 创建治疗修改
	var heal_mod = StatModification.new()
	heal_mod.stat_name = "health"
	heal_mod.modification_type = StatModification.ModificationType.ADD
	heal_mod.value = 10
	
	effect.stat_modifications.append(heal_mod)
	return effect

# 创建一个每回合给敌人减血的效果
static func create_poison_effect() -> ScheduledEffect:
	var effect = ScheduledEffect.new()
	effect.id = "poison_damage"
	effect.trigger_type = ScheduledEffect.TriggerType.PHASE_SPECIFIC
	effect.target_type = ScheduledEffect.TargetType.ENEMY
	effect.trigger_phase = TurnPhaseConstants.ENEMY_END  # 改为敌人回合结束时触发
	effect.is_repeating = true
	effect.repeat_interval = 1
	effect.max_triggers = 5  # 最多触发5次
	
	# 创建毒伤修改
	var poison_mod = StatModification.new()
	poison_mod.stat_name = "health"
	poison_mod.modification_type = StatModification.ModificationType.ADD
	poison_mod.value = -3  # 每回合减3血
	
	effect.stat_modifications.append(poison_mod)
	return effect

# 创建一个基于血量阈值的紧急治疗效果
static func create_emergency_heal() -> ScheduledEffect:
	var effect = ScheduledEffect.new()
	effect.id = "emergency_heal"
	effect.trigger_type = ScheduledEffect.TriggerType.RESOURCE_THRESHOLD
	effect.target_type = ScheduledEffect.TargetType.PLAYER
	effect.resource_type = "health"
	effect.resource_threshold = 20  # 血量低于20时触发
	effect.is_repeating = false
	
	# 创建紧急治疗修改
	var emergency_heal_mod = StatModification.new()
	emergency_heal_mod.stat_name = "health"
	emergency_heal_mod.modification_type = StatModification.ModificationType.ADD
	emergency_heal_mod.value = 15
	
	effect.stat_modifications.append(emergency_heal_mod)
	return effect

# 创建一个在玩家抽牌阶段给予额外法力的效果
static func create_mana_boost() -> ScheduledEffect:
	var effect = ScheduledEffect.new()
	effect.id = "mana_boost"
	effect.trigger_type = ScheduledEffect.TriggerType.PHASE_SPECIFIC
	effect.target_type = ScheduledEffect.TargetType.PLAYER
	effect.trigger_phase = TurnPhaseConstants.PLAYER_DRAW
	effect.is_repeating = true
	effect.repeat_interval = 2  # 每2回合触发一次
	
	# 创建法力增加修改
	var mana_mod = StatModification.new()
	mana_mod.stat_name = "mana"
	mana_mod.modification_type = StatModification.ModificationType.ADD
	mana_mod.value = 2
	
	effect.stat_modifications.append(mana_mod)
	return effect
